import java.math.*;

public class OutputGate implements Gate{

    BigInteger share;
    int ID;
    int gateID, gateType;

    public OutputGate(int ID, Gate g){
        this.ID = ID;
        gateID = g.getID();
        if(g instanceof InputGate){
            gateType = Utilities.INPUTGATE;
        }else if(g instanceof ConstGate){
            gateType = Utilities.CONSTGATE;
        }else if(g instanceof AddGate){
            gateType = Utilities.ADDGATE;
        }else{
            gateType = Utilities.MULTGATE;
        }

    }   

    public OutputGate(int ID){
        this.ID = ID;
    }

    public BigInteger getShare(){
        return share;
    }

    public void setShare(BigInteger share){
        this.share = share;
    }

    public int getID(){
        return ID;
    }

    public OutputGate copy(){
        OutputGate copy = new OutputGate(ID);
        copy.gateID = gateID;
        copy.gateType = gateType;
        if(share != null){
            copy.setShare(share);
        }
        return copy;
    }
}